

var pageContext = new PageContextDatatable(settings||{});
pageContext.formInit = function(layero){
}

pageContext.getOtherOperBtn = function(id,label,record){
	var html = [];	
	return html.join("");
}
pageContext.getOtherPingPuOperBtn = function(id,label,record){
	var html = [];
	return html.join("");
}

pageContext.renderAfterEventOther = function(){
 
} 
pageContext.toAdd = function(option){
	 var me = $(option.target);
	 var string = me.attr("para-data");
	var action = window.global.getFinalUrl(pageContext.setting.toAddUrl);
 	var pairs = string.split('&'), d = decodeURIComponent, name, value;
	$.each(pairs, function(i, pair) {
		pair = pair.split('=');
		name = d(pair[0]);
		value = d(pair[1]);
		action = window.global.addPara(action,name,value);
	});
	load(action,"page-content",true,"新增"+pageContext.modelName,function(){
		
	});
}
pageContext.toDetail = function(id,data){
	var action = window.global.getFinalUrl(pageContext.setting.toDetailUrl);
	action = window.global.addPara(action,"id",id,true)
	load(action,"page-content",true,pageContext.modelName+"详情",function(){
		
	});
}
pageContext.toUpdate = function(id,data){
	var action = window.global.getFinalUrl(pageContext.setting.toUpdateUrl);
	action = window.global.addPara(action,"id",id,true)
	load(action,"page-content",true,"修改"+pageContext.modelName,function(){
		
	});
}
jQuery(function($) {
   pageContext.init();

	 $(document).find("input").each(function(){
		 $(this).attr("autocomplete","off");
	 });
   var layero = $("#searchForm");
	layero.find('select[novalid!="true"]').each(function(){
		var novalid = $(this).attr("noconvert");
		if(novalid!="true"){
			var $span = layero.find(this).select2({
	            language: "zh-CN"
		            ,matcher:select2Matcher})
	            .next("span")
	            ;
		}
	  });
}); 
